/****************************************Copyright (c)**************************************************
**                                         2016-03
**
**                                
**
**
**--------------File Info-------------------------------------------------------------------------------
** File name:		    ht6x1x_i2c.h
** Last modified Date:  2016-03-29
** Last Version:		v1.0
** Descriptions:		
**
**------------------------------------------------------------------------------------------------------
** Created by:			Evan Chen
** Created date:		2016-03-29
** Version:				v1.0
** Descriptions:		
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __HT6X1X_I2C_H
#define __HT6X1X_I2C_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "ht60xx.h"

/*I2CDAT*/
#define I2CDAT_MASK       		((uint16_t)0x00FF)

/*I2CADR*/
#define I2CADR_MASK      		((uint16_t)0x00FE)

#define I2CADR_ADDR_MASK      	((uint16_t)0x0001)
#define SPICON_ADDR_UNKNOW    ((uint16_t)0x0000)
#define SPICON_ADDR_KNOW       	((uint16_t)0x0001)

/*I2CCON*/
#define I2CCON_CR_MASK      		((uint16_t)0x7F00)

#define I2CCON_ENS1_MASK      	((uint16_t)0x0080)
#define I2CCON_ENS1_DIS    		((uint16_t)0x0000)
#define I2CCON_ENS1_EN       		((uint16_t)0x0080)

#define I2CCON_STA_MASK      	((uint16_t)0x0040)
#define I2CCON_STA_DIS    		((uint16_t)0x0000)
#define I2CCON_STA_EN       		((uint16_t)0x0040)

#define I2CCON_STO_MASK      	((uint16_t)0x0020)
#define I2CCON_STO_DIS    		((uint16_t)0x0000)
#define I2CCON_STO_EN       		((uint16_t)0x0020)

#define I2CCON_SI_MASK      		((uint16_t)0x0080)

#define I2CCON_AA_MASK      		((uint16_t)0x0080)
#define I2CCON_AA_DIS    		((uint16_t)0x0000)
#define I2CCON_AA_EN       		((uint16_t)0x0080)

/*I2CSTA*/
#define I2CSTA_MASK      		((uint16_t)0x00F8)

void I2C_Enable(HT_I2C_TypeDef  *I2Cx);
void I2C_Disable(HT_I2C_TypeDef  *I2Cx);

#ifdef __cplusplus
}
#endif

#endif /* __HT6X1X_I2C_H */

